﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Deloitte
{
    public class ControlsHelper
    {
        public static void FormatButtons(Control control, ButtonColorStyle style)
        {
            foreach (Control obj in control.Controls)
            {
                if (obj is Button)
                {
                    FormatButton((Button)obj, style);
                }
                else if (obj.Controls.Count > 0)
                {
                    Deloitte.ControlsHelper.FormatButtons(obj,style);
                }
            }
        }

        private static void FormatButton(Button button, ButtonColorStyle style)
        {            
            button.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            button.BackColor = System.Drawing.Color.RoyalBlue;
            button.ForeColor = System.Drawing.Color.WhiteSmoke;
            button.UseVisualStyleBackColor = true;                        
        }
        public enum ButtonColorStyle{ BlueFlat}
    }
}
